<template>
  <a-button>
    <template v-if="icon" #icon>
      <component :is="icon"></component>
    </template>
    {{ text }}
  </a-button>
</template>

<script setup lang="ts">
withDefaults(
  defineProps<{
    icon?: string
    text?: string
  }>(),
  {
    icon: '',
    text: '简单的按钮',
  }
)
</script>
